package dd.model;

import java.util.ArrayList;
import java.util.HashSet;

public class Event {
	/**
	 * the local event for saving some information about an event the local event do not need to know all the user's
	 * information of the entire event so we put the user name, password, mypostion etc information to the event class
	 * which means the local event only record this user's information We will get this class looks pretty for example
	 * make choice a class and put the edge information into choice
	 * 
	 * README INCLUDES SOME RUNNING INSTRUCTION
	 */
	String Choices[] = new String[10]; // record all the choice name
	String name; // this event name
	String ID; // this event id
	String clientID; // this clientID, make the user know if the response is
						// directly send to him, because some response maybe a broadcast
	int numLines; // number of lines
	int numEdges; // number of edges for each one
	int myPostion; // get from the server, the order of a player, for moderator is 0
	String Mode; // open or closed
	String Type; // roundRobin or asynchronous
	int leftEdges; // the number of edge this user left
	String UserName; // this user's userName
	String Password; // this user's password
	boolean ModSignIn; // if this is a moderator
	boolean IsYourTurn; // if it is this user's turn
	boolean Iscompleted; // if this event is complete
	HashSet s = new HashSet();// use for the AddChoiceResponseController
	ArrayList<Edge> edge = new ArrayList();// record all the edges that have beed added
	String myResult;

	public Event() {
		ID = "135";
		name = "Where to eat our dinner?";
		UserName = "DD";
		Password = "123";
		numLines = 2;
		numEdges = 2;
		leftEdges = 2;
		Mode = "open";
		Type = "roundRobin";
		ModSignIn = false;
		IsYourTurn = true;
		Iscompleted = false;
		myResult = "";

		Choices[0] = "Moderator Choice";
		Choices[1] = "1st user Choices";
		Choices[2] = "2nd user Choices";
		Choices[3] = "3rd user Choices";
		Choices[4] = "Choices";
		Choices[5] = "Choices";
		Choices[6] = "Choices";
		Choices[7] = "Choices";
		Choices[8] = "Choices";
		Choices[9] = "Choices";

	}

	// HACK
	public void setUserName(String un) {
		this.UserName = un;
	}

	public String getUserName() {
		return UserName;
	}

	public void setPassword(String pw) {
		this.Password = pw;
	}

	public String getPassword() {
		return Password;
	}

	public void setAsModerator() {
		ModSignIn = true;
	}

	public boolean isModSignIn() {
		return ModSignIn;
	}

	public void setModName(String mn) {
		this.UserName = mn;
	}

	public void setModPass(String mp) {
		this.Password = mp;
	}

	public void setLeftEdges() {
		this.leftEdges = numEdges;
	}

	public void leftEdgesDecrement() {
		leftEdges--;
	}

	public boolean isNoEdges() {
		if (leftEdges > 0) {
			return true;
		}
		return false;
	}

	public int getleftEdges() {
		return leftEdges;
	}

	public int getNumberLines() {
		return numLines;
	}

	public void setNumberLines(int nl) {
		this.numLines = nl;
	}

	public int getNumberEdges() {
		return numEdges;
	}

	public void setNumberEdges(int ne) {
		this.numEdges = ne;
		this.setLeftEdges();
	}

	public String getChoice(int i) {
		return Choices[i];
	}

	public void setChoice(int i, String s) {
		Choices[i] = s;
	}

	public String getType() {
		return Type;
	}

	public void setType(String type) {
		Type = type;
	}

	public String getMode() {
		return Mode;
	}

	public void setMode(String mode) {
		Mode = mode;
	}

	public String getEventName() {
		return name;
	}

	public void setEventName(String name) {
		this.name = name;
	}

	public void setEventID(String id) {
		ID = id;
	}

	public String getEventID() {
		return ID;
	}

	public boolean isIDValid(String id) {
		return id.equals(ID);
	}

	public void setclientid(String id) {
		clientID = id;
	}

	public String returnclientid() {
		return clientID;
	}

	public void setPostion(int p) {
		myPostion = p;
	}

	public int getPostion() {
		return myPostion;
	}

	public HashSet getset() {
		return s;
	}

	public void setset(HashSet hs) {
		s = hs;
	}

	public void setIsYourTurn(boolean a) {
		IsYourTurn = a;
	}

	public boolean getIsYourturn() {
		return IsYourTurn;
	}

	public ArrayList<Edge> getedgelist() {
		return edge;
	}

	public void setedgelist(ArrayList<Edge> e) {
		this.edge = e;
	}

	public void setcomplete(boolean c) {
		this.Iscompleted = c;
	}

	public boolean getIscompleted() {
		return Iscompleted;
	}

	public String getMyResult() {
		return myResult;
	}

	public void setMyResult(String myResult) {
		this.myResult = myResult;
	}

}
